import urandom
import utils


class Config:
    # OneNet MQTT Host IP
    MQTT_HOST = "192.168.2.3"
    MQTT_HOST_PORT = 1883

    # Device ID
    MQTT_CLIENT_ID = utils.chip_id() + str(
        urandom.getrandbits(30))  # 意外断电，重连加上随机数 client_id不能重复 解决 [Errno 103] ECONNABORTED MQTT

    # User Name
    MQTT_USERNAME = None

    # Password
    MQTT_PASSWORD = None

    MQTT_TOPIC_SUB = 'home/nas/pw/ctl'
    MQTT_TOPIC_PUB = utils.chip_id() + '/gpio/12'

    MQTT_KEEP_ALIVE = 60

    ON = "1"
    OFF = "0"
    HELLO = "hello"
    MAX_LOW_COUNT = 6
